package com.knowvoyage.knowvoyageserver.mapper;

import com.knowvoyage.knowvoyageserver.pojo.entity.Favorite;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FavoriteMapper {
    void insert(Favorite favorite);
    void delete(Long favoriteId);
    void update(Favorite favorite);
    Favorite selectById(Long favoriteId);
    Favorite selectByMessageAndUser(Long messageId, Long userId);
    List<Favorite> selectByUserId(Long userId);
    List<Favorite> selectAll();
    List<Favorite> selectByIds(@Param("ids") List<Long> ids);
    void batchDelete(@Param("ids") List<Long> ids);
    int countByUserId(@Param("userId") Long userId);
    int countByMessageId(@Param("messageId") Long messageId);
    int batchInsert(@Param("favorites") List<Favorite> favorites);

}
